import currency from 'currency.js'
const precision = 2

const install = (Vue, vm) => {

	Vue.prototype.$t = {
		// 测试加法
		toUpperCase(arg) {
			return arg && arg.toUpperCase();
		}
	}
	
	// 金额加减，格式化
	Vue.prototype.$amount = (val) => {
		return currency(val, {
			separator: '',
			decimal: '.',
			precision,
			symbol: '',
			formatWithSymbol: true
		})
	}
}

export default {
	install
}
